package com.neusoft.tyut;

import com.neusoft.tyut.factory.Factory;
import com.neusoft.tyut.factory.FactoryManager;
import com.neusoft.tyut.factory.SimpleFactory;
import com.neusoft.tyut.obj.Box;
import com.neusoft.tyut.obj.Tag;
import com.neusoft.tyut.obj.Water;


import java.sql.*;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        Water water = FactoryManager.produce("colo");
        Box  box  = water.prepareBox();
        System.out.println(water);
        System.out.println(box);
    }
    public static void main3(String[] args) {
        Factory factory = SimpleFactory.produce("beer");
        Box box = factory.produceBox();
        Water water =  factory.produceWater();
        Tag tag =  factory.produceTag();
        factory.full(water,tag,box);
    }

    public static void main2(String[] args) throws SQLException, ClassNotFoundException {

        Class.forName("java.sql.Driver"); //  jdbc:mysql:

        Class.forName("Oracle"); // jdbc:oracle:thin
//                                         http:

// MySQL 系列对象
        Connection connection = DriverManager.getConnection("url", "", "");
//        LoadBalancedMySQLConnection
//        LogicalConnection
        PreparedStatement preparedStatement = connection.prepareStatement("");
//        ServerPreparedStatement
//        oracle$1jdbc$1replay$1driver$1NonTxnReplayableStatement$2oracle$1jdbc$1OracleCallableStatement$$$Proxy
        ResultSet resultSet = preparedStatement.executeQuery("");
//        UpdatableResultSet
//        SyncResolverImpl
        resultSet.next();


    }
}